package com.atguigu.mediator.smarthouse;

//具体同事类
public class Alarm extends Colleague {

	public Alarm(Mediator mediator, String name) {
		super(mediator, name);
		// 创建 具体同事类的 同时，将自己 放入 具体中介者的 集合中去
		mediator.Register(name, this);
	}

	public void SendAlarm(int stateChange) {
		SendMessage(stateChange);
	}

	@Override
	public void SendMessage(int stateChange) {
		// 调用中介者的方法
		this.getMediator().GetMessage(stateChange, this.name);
	}

}
